package com.example.administrator.testxingpiao.ui.perfom;

import android.util.Log;

import com.example.administrator.testxingpiao.bean.PerformBean;
import com.example.administrator.testxingpiao.httputils.HttpUtils;

import java.util.HashMap;

/**
 * Created by Administrator on 2016/8/5.
 */
public class ContentPresenter implements ContentContract.Presenter {

    private final ContentContract.View view;
    private final ContentContract.Modle model;

    public ContentPresenter(ContentContract.View view, ContentContract.Modle model){

        this.view = view;
        this.model = model;
    }

    @Override
    public void initData(HashMap<String, String> params) {
        log("进入presneter data方法");
    model.getPerform(params, new HttpUtils.HttpCallBack<PerformBean>() {

    @Override
    public void onSuceess(PerformBean performBean) {
    view.onSuccessGetContent(performBean);
    }

    @Override
    public void onFail() {

    }
});
    }

    public void log(String msg){
        view.onFailGetPerform("加载失败");
        Log.i("TAG",msg);
    }

}
